package cn.thoughtworks.school.programCenter.entities.commands;

import cn.thoughtworks.school.programCenter.entities.UserAssignmentDuration;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.Date;

@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class CreateUserAssignmentDurationCommand {
    private Long taskId;
    private Long assignmentId;
    private Long userId;

    public UserAssignmentDuration build() {
        return UserAssignmentDuration.builder()
            .assignmentId(this.assignmentId)
            .taskId(this.taskId)
            .userId(this.userId)
            .startTime(new Date())
            .endTime(null)
            .build();

    }
}
